#include <bits/stdc++.h>

using namespace std;
#define int long long
const int inf = 0x3f3f3f3f3f3f3f3f;

void solve()
{
	int n, m;
	cin >> n >> m;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	int k;
	cin >> k;
	vector<int> left, right;
	vector<int> pre(1, 0);
	for (int i = 1; i < n; i++)
	{
		if (a[i] > a[i - 1])
		{
			left.push_back(i);
			right.push_back(i + 1);
			pre.push_back(pre.back() + a[i] - a[i - 1]);
		}
	}
	//	for(int i = 0;i < left.size();i++) cout << left[i] << ' ';
	//	cout << endl;
	//	for(int i = 0;i < right.size();i++) cout << right[i] << ' ';
	//	cout << endl;
	//	for(int i = 0;i < pre.size();i++) cout << pre[i] << ' ';
	//	cout << endl;
	while (m--)
	{
		int s, t;
		cin >> s >> t;
		int l = lower_bound(left.begin(), left.end(), s) - left.begin();
		int r = lower_bound(right.begin(), right.end(), t) - right.begin();
		if (l == left.size())
		{
			cout << k << endl;
			continue;
		}
		if (right[r] != t || r == right.size()) r--;
		cout << pre[r + 1] - pre[l] + k << '\n';
	}

}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int _ = 1;
	//cin >> _;
	while (_--)
	{
		solve();
	}
	return 0;
}